package com.legendshop.openportal.sdk.model.request.v4;

import com.legendshop.openportal.sdk.annotation.EnumValid;
import com.legendshop.openportal.sdk.model.BaseRequest;
import com.legendshop.openportal.sdk.model.constants.AccountTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

import static com.legendshop.openportal.sdk.model.constants.ApiPathConstantsV4.GET_AUTHORIZE_CODE_V4;

/**
 * @author jzh
 * @version 1.0.0
 * @title MerchantLoginV4Request
 * @date 2025/4/11 16:36
 * @description：租户登录请求
 */
@Data
public class MerchantLoginV4Request extends BaseRequest {

    private static final long serialVersionUID = -1420435436489834264L;

    @ApiModelProperty(value = "账号ID", required = true)
    @Length(max = 64, message = "账号ID长度不能超过64位")
    @NotBlank(message = "账号ID不能为空")
    private String accountId;

    @ApiModelProperty(value = "账号类型", notes = "ID=租户ID、MOBILE=手机号", required = true)
    @EnumValid(target = AccountTypeEnum.class, message = "账号类型不能为空")
    private String accountType;

    @ApiModelProperty(value = "来源页面地址(登录失败时，会返回到该页面，并带上error参数)")
    private String backUrl;

    @Override
    public String getApiPath() {
        return GET_AUTHORIZE_CODE_V4;
    }
}
